<html>

<body>


<SCRIPT LANGUAGE="JavaScript" SRC="javascript/sorttable.js"> </SCRIPT>

<style>

#tablefont{
        font-family: "Comic Sans MS", "Brush Script MT", cursive;
        font-size:13 px;
        background: #fefefe;
        border: none;
        height : 25 px;
//      border-bottom: 1px solid black;

}

</style>


<center>
<p><br>
<div id="eline">Santa Clara Tennis Club Membership List </div
<p><br>

<table class="sortable" id="tablefont" >

<thead>
<tr>
<th scope="col">Year</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">NTRP</th>
<th scope="col">Email</th>
<th scope="col">Phone</th>

<?php

if( isset( $_GET["full"]) ){
   echo '<th scope="col">Address</th>';
   echo '<th scope="col">City</th>';
}

?>
</tr>
</thead>

<!-- <div align="center" id="eline">
-->

<?php

  include "library.php";

  DBConnect();
  $query = "select * from membership  order by lname asc";

  $query_results=mysql_query($query);

  while ($row = mysql_fetch_assoc($query_results)) {  

     $EMAIL = $row[EMAIL]."@".$row[URL];
     if( strlen($EMAIL) < 5)  $EMAIL = $URL= "";

     $PHONE = "(".$row[AREACODE].") ".$row[PHONE];
     if( strlen($PHONE) < 13)  $PHONE = "";

     echo "<tr>";
     echo "<td>".$row[YEAR]."</td>";
     echo "<td>".$row[FNAME]."</td>";
     echo "<td>".$row[LNAME]."</td>";
     $GENDER="";
     if( $row[GENDER] == "W" ) $GENDER="W";
     if( $row[GENDER] == "M" ) $GENDER="M";
     echo "<td>".$GENDER.$row[NTRP]."</td>";
     echo "<td>".$EMAIL."</td>";
     echo "<td>".$PHONE."</td>";

     if( isset( $_GET["full"]) ){
         echo "<td>".$row[ADDRESS]."</td>";
         echo "<td>".$row[CITY]."</td>";
     }

     echo "</tr>";
     echo "\n";

  }


?>


</table>
